import 'package:speed_random/generated/json/base/json_convert_content.dart';
import 'package:speed_random/generated/mode_user_info_entity.dart';

ModeUserInfoEntity $ModeUserInfoEntityFromJson(Map<String, dynamic> json) {
  final ModeUserInfoEntity modeUserInfoEntity = ModeUserInfoEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    modeUserInfoEntity.id = id;
  }
  final String? username = jsonConvert.convert<String>(json['username']);
  if (username != null) {
    modeUserInfoEntity.username = username;
  }
  final String? fingerprint = jsonConvert.convert<String>(json['fingerprint']);
  if (fingerprint != null) {
    modeUserInfoEntity.fingerprint = fingerprint;
  }
  final int? money = jsonConvert.convert<int>(json['money']);
  if (money != null) {
    modeUserInfoEntity.money = money;
  }
  final int? integral = jsonConvert.convert<int>(json['integral']);
  if (integral != null) {
    modeUserInfoEntity.integral = integral;
  }
  final String? overdate = jsonConvert.convert<String>(json['overdate']);
  if (overdate != null) {
    modeUserInfoEntity.overdate = overdate;
  }
  final bool? isvip = jsonConvert.convert<bool>(json['isvip']);
  if (isvip != null) {
    modeUserInfoEntity.isvip = isvip;
  }
  final int? viptime = jsonConvert.convert<int>(json['viptime']);
  if (viptime != null) {
    modeUserInfoEntity.viptime = viptime;
  }
  return modeUserInfoEntity;
}

Map<String, dynamic> $ModeUserInfoEntityToJson(ModeUserInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['username'] = entity.username;
  data['fingerprint'] = entity.fingerprint;
  data['money'] = entity.money;
  data['integral'] = entity.integral;
  data['overdate'] = entity.overdate;
  data['isvip'] = entity.isvip;
  data['viptime'] = entity.viptime;
  return data;
}

extension ModeUserInfoEntityExtension on ModeUserInfoEntity {
  ModeUserInfoEntity copyWith({
    int? id,
    String? username,
    String? fingerprint,
    int? money,
    int? integral,
    String? overdate,
    bool? isvip,
    int? viptime,
  }) {
    return ModeUserInfoEntity()
      ..id = id ?? this.id
      ..username = username ?? this.username
      ..fingerprint = fingerprint ?? this.fingerprint
      ..money = money ?? this.money
      ..integral = integral ?? this.integral
      ..overdate = overdate ?? this.overdate
      ..isvip = isvip ?? this.isvip
      ..viptime = viptime ?? this.viptime;
  }
}